Skip to content

Fix CI - #101

Merged
tattn merged 1 commit into
mainfrom
fix/ci
Aug 25, 2026
Merged

Fix CI#101
tattn merged 1 commit into
mainfrom
fix/ci

Conversation

@tattn

@tattn tattn commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

CI has been red on main since the Gemma 4 merge. This fixes the three failing jobs: the Llama tests timed out, the iOS example build had no matching destination, and the Ubuntu build never compiled.

Changes

llama backend

  • Default thread count no longer collapses to a single thread on small machines — a 3-core CI VM was running llama.cpp with n_threads = 1.
  • textStream(from:) discards tokens left pending by a generation that ended early. Appending the next prompt on top of them wrote past the batch allocation (Batch.swift:20: Fatal error: Unexpectedly found nil). Covered by decodeAfterCancelledGeneration().

Package.swift

  • The Apple and Linux definitions of LocalLLMClientLlamaC now share their C/C++ settings. The Linux copy was missing -UDEBUG, LLAMA_BUILD_NUMBER and the common header path, so constexpr bool DEBUG in mtmd-audio.cpp failed to compile.
  • utils.h gets #pragma once. It is both listed in the module map and included by LocalLLMClientLlamaC.h, which defined llm_chat_params twice on Linux.

Tests

  • Split toolCallWithMultipleTools() into one test per behaviour; it packed two tool round-trips into a single time limit.
  • Pinned the tool model's sampling (seed: 0, temperature: 0.1) so tool calling is deterministic.
  • Raised the model suites' time limit to 10 minutes — CI measures ~4.6x slower than a local run.

Workflow

  • GGML_METAL_DEVICES=0. A hosted runner only has the Apple Paravirtual device, which reports simdgroup reduction = false, so llama.cpp runs every matmul on the CPU anyway while still paying for the backend split and the Metal shader compilation.
  • iOS example builds against generic/platform=iOS Simulator. The pinned OS=26.4 does not exist on the runner image, which ships 26.4.1.
  • llama.cpp Linux binaries are downloaded as .tar.gz; the .zip asset no longer exists. Added curl -f so a future rename fails at the download.

Test plan

  • All five CI jobs green.
  • Linux build also verified locally in a swift:6.1 container, since this job sits behind needs: test-macos.

@tattn
tattn force-pushed the fix/ci branch 2 times, most recently from 6758eab to 54be778 Compare August 25, 2026 14:52
@tattn
tattn merged commit d92cb1f into main Aug 25, 2026
5 checks passed
@tattn
tattn deleted the fix/ci branch August 25, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant